home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / mach / mach_types.defs < prev    next >
Text File  |  1994-11-14  |  13KB  |  441 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    mach_types.defs,v $
  29.  * Revision 2.13  93/01/14  17:44:32  danner
  30.  *     64bit cleanup.  All types now based on integer_t/natural_t.
  31.  *     [92/12/01            af]
  32.  * 
  33.  * Revision 2.12  92/03/10  16:26:58  jsb
  34.  *     NORMA_VM: use xmm_kobj_lookup to convert memory_object_control ports.
  35.  *     From durriya@ri.osf.org: defined kernel_boot_info_t.
  36.  *     [92/03/07  08:30:08  jsb]
  37.  * 
  38.  * Revision 2.11  92/01/14  16:45:29  rpd
  39.  *     Added translations for memory_object_name_t.
  40.  *     [92/01/06  21:49:29  rpd]
  41.  * 
  42.  * Revision 2.10  92/01/03  20:46:29  dbg
  43.  *     Changed emulation_vector_t to pass data out-of-line.  Renamed
  44.  *     old type to xxx_emulation_vector_t for compatibility.
  45.  *     Removed vm_page_data_t.
  46.  *     [92/01/03            dbg]
  47.  * 
  48.  * Revision 2.9  91/08/28  11:15:16  jsb
  49.  *     Increased the size of mach_port_status_t, for mps_seqno.
  50.  *     Added old_mach_port_status_t, for compatibility purposes.
  51.  *     [91/08/09            rpd]
  52.  *     Add memory_object_return_t for precious page support.
  53.  *     [91/07/03  14:04:25  dlb]
  54.  * 
  55.  * Revision 2.8  91/06/25  10:30:10  rpd
  56.  *     Changed the port-based type declarations
  57.  *     to use mach_port_t as the C type name.
  58.  *     [91/05/23            rpd]
  59.  * 
  60.  * Revision 2.7  91/06/06  17:08:02  jsb
  61.  *     Added emulation_vector_t for new get/set emulation vector calls.
  62.  *     [91/05/24  17:45:33  jsb]
  63.  * 
  64.  * Revision 2.6  91/05/14  16:55:06  mrt
  65.  *     Correcting copyright
  66.  * 
  67.  * Revision 2.5  91/02/05  17:33:39  mrt
  68.  *     Changed to new Mach copyright
  69.  *     [91/02/01  17:18:30  mrt]
  70.  * 
  71.  * Revision 2.4  90/08/07  18:00:26  rpd
  72.  *     Added processor_set_name_array_t.
  73.  *     [90/08/06            rpd]
  74.  * 
  75.  * Revision 2.3  90/06/02  14:58:35  rpd
  76.  *     Added mach_port_status_t.
  77.  *     [90/05/13            rpd]
  78.  *     Converted to new IPC.
  79.  *     [90/03/26  22:33:34  rpd]
  80.  * 
  81.  * Revision 2.2  90/01/22  23:05:44  af
  82.  *     Added vm_attribute()'s types.
  83.  *     [89/12/09  10:45:16  af]
  84.  * 
  85.  * Revision 2.1  89/08/03  17:17:40  rwd
  86.  * Created.
  87.  * 
  88.  * Revision 2.3  89/02/25  18:37:59  gm0w
  89.  *     Changes for cleanup.
  90.  * 
  91.  * Revision 2.2  89/01/15  16:30:33  rpd
  92.  *     Moved from kern/ to mach/.
  93.  *     [89/01/15  14:36:47  rpd]
  94.  * 
  95.  * Revision 2.6  89/01/12  07:57:37  rpd
  96.  *     Moved standard stuff to std_types.defs.  Moved debugging definitions
  97.  *     like ipc_statistics_t out to other files.
  98.  *     [89/01/12  04:50:24  rpd]
  99.  * 
  100.  * Revision 2.5  89/01/04  13:37:11  rpd
  101.  *     Increased size of fpa_counters_t.
  102.  *     [89/01/03  16:46:38  rpd]
  103.  *     
  104.  *     Added fpa_counters_t type.
  105.  *     [89/01/01  15:03:09  rpd]
  106.  * 
  107.  * Revision 2.4  88/09/25  22:15:16  rpd
  108.  *     Bumped size of callout_statistics_t to account for the
  109.  *     new field, cos_num_untimeout_hit.
  110.  *     [88/09/09  23:14:38  rpd]
  111.  *     
  112.  *     Fixed log.  Changed includes to the new style.
  113.  *     Added definitions of callout_info_t,
  114.  *     callout_info_array_t, callout_statistics_t.
  115.  *     [88/09/09  04:46:31  rpd]
  116.  * 
  117.  */
  118. /*
  119.  *    Mach kernel interface type declarations
  120.  */
  121.  
  122. #ifndef    _MACH_MACH_TYPES_DEFS_
  123. #define _MACH_MACH_TYPES_DEFS_
  124.  
  125. /*
  126.  *    For KernelServer and KernelUser interfaces, Mig will
  127.  *    automagically use ipc_port_t instead of mach_port_t
  128.  *    on the kernel side of the interface.  For example,
  129.  *    convert_task_to_port really returns ipc_port_t.
  130.  *    Doing this in Mig saves many explicit conditional
  131.  *    cusertype/cservertype declarations.
  132.  *
  133.  *    Mig doesn't translate the components of an array.
  134.  *    For example, Mig won't use the thread_t translations
  135.  *    to translate a thread_array_t argument.
  136.  */
  137.  
  138. #include <mach/std_types.defs>
  139.  
  140. #ifdef    NEW_MACH_IPC
  141.  
  142. #if    KERNEL_SERVER
  143. #include <norma_vm.h>
  144. #endif    KERNEL_SERVER
  145.  
  146. type mach_port_status_t = struct[9] of integer_t;
  147.  
  148. type old_mach_port_status_t = struct[8] of integer_t;    /* compatibility */
  149.  
  150. type task_t = mach_port_t
  151.         ctype: mach_port_t
  152. #if    KERNEL_SERVER
  153.         intran: task_t convert_port_to_task(mach_port_t)
  154.         outtran: mach_port_t convert_task_to_port(task_t)
  155.         destructor: task_deallocate(task_t)
  156. #endif    KERNEL_SERVER
  157.         ;
  158.  
  159. type thread_t = mach_port_t
  160.         ctype: mach_port_t
  161. #if    KERNEL_SERVER
  162.         intran: thread_t convert_port_to_thread(mach_port_t)
  163.         outtran: mach_port_t convert_thread_to_port(thread_t)
  164.         destructor: thread_deallocate(thread_t)
  165. #endif    KERNEL_SERVER
  166.         ;
  167.  
  168. type thread_state_t        = array[*:1024] of natural_t;
  169.  
  170. type task_array_t = ^array[] of task_t;
  171. type thread_array_t = ^array[] of thread_t;
  172.  
  173. type vm_task_t = mach_port_t
  174.         ctype: mach_port_t
  175. #if    KERNEL_SERVER
  176.         intran: vm_map_t convert_port_to_map(mach_port_t)
  177.         destructor: vm_map_deallocate(vm_map_t)
  178. #endif    KERNEL_SERVER
  179.         ;
  180.  
  181. type ipc_space_t = mach_port_t
  182.         ctype: mach_port_t
  183. #if    KERNEL_SERVER
  184.         intran: ipc_space_t convert_port_to_space(mach_port_t)
  185.         destructor: space_deallocate(ipc_space_t)
  186. #endif    KERNEL_SERVER
  187.         ;
  188.  
  189. type vm_address_t = natural_t;
  190. type vm_offset_t = natural_t;
  191. type vm_size_t = natural_t;
  192. type vm_prot_t = int;
  193. type vm_inherit_t = int;
  194. type vm_statistics_data_t = struct[13] of integer_t;
  195. type vm_machine_attribute_t = int;
  196. type vm_machine_attribute_val_t = int;
  197.  
  198. type thread_info_t        = array[*:1024] of natural_t;
  199. type thread_basic_info_data_t    = struct[11] of integer_t;
  200. type thread_sched_info_data_t    = struct[7] of integer_t;
  201.  
  202. type task_info_t        = array[*:1024] of natural_t;
  203. type task_basic_info_data_t    = struct[8] of integer_t;
  204. type task_events_info        = struct[7] of natural_t;
  205. type task_thread_times_info_data_t = struct[4] of integer_t;
  206.  
  207.  
  208. type memory_object_t = mach_port_t
  209.         ctype: mach_port_t
  210. #if    KERNEL_SERVER
  211.         intran: ipc_port_t null_conversion(mach_port_t)
  212. #endif    KERNEL_SERVER
  213.         ;
  214.  
  215. type memory_object_control_t = mach_port_t
  216.         ctype: mach_port_t
  217. #if    KERNEL_SERVER
  218. #if    NORMA_VM
  219.         intran: mach_xmm_obj_t xmm_kobj_lookup(mach_port_t)
  220. #else    NORMA_VM
  221.         intran: vm_object_t vm_object_lookup(mach_port_t)
  222. #endif    NORMA_VM
  223. #endif    KERNEL_SERVER
  224.         ;
  225.  
  226. type memory_object_name_t = mach_port_t
  227.         ctype: mach_port_t
  228. #if    KERNEL_SERVER
  229.         intran: vm_object_t vm_object_lookup_name(mach_port_t)
  230.         destructor: vm_object_deallocate(vm_object_t)
  231. #endif    KERNEL_SERVER
  232.         ;
  233.  
  234. type memory_object_copy_strategy_t = int;
  235. type memory_object_return_t = int;
  236.  
  237. type machine_info_data_t = struct[5] of integer_t;
  238. type machine_slot_data_t = struct[8] of integer_t;
  239.  
  240. type host_t = mach_port_t
  241.         ctype: mach_port_t
  242. #if    KERNEL_SERVER
  243.         intran: host_t convert_port_to_host(mach_port_t)
  244.         outtran: mach_port_t convert_host_to_port(host_t)
  245. #endif    KERNEL_SERVER
  246.         ;
  247.  
  248. type host_priv_t = mach_port_t
  249.         ctype: mach_port_t
  250. #if    KERNEL_SERVER
  251.         intran: host_t convert_port_to_host_priv(mach_port_t)
  252. #endif    KERNEL_SERVER
  253.         ;
  254.  
  255. type host_info_t             = array[*:1024] of natural_t;
  256. type host_basic_info_data_t        = struct[5] of integer_t;
  257. type host_sched_info_data_t        = struct[2] of int;
  258. type host_load_info_data_t        = struct[6] of integer_t;
  259.  
  260.  
  261. type processor_t = mach_port_t
  262.         ctype: mach_port_t
  263. #if    KERNEL_SERVER
  264.         intran: processor_t convert_port_to_processor(mach_port_t)
  265.         outtran: mach_port_t convert_processor_to_port(processor_t)
  266. #endif    KERNEL_SERVER
  267.         ;
  268.  
  269. type processor_array_t         = ^array[] of processor_t;
  270. type processor_info_t        = array[*:1024] of natural_t;
  271. type processor_basic_info_data_t = struct[5] of integer_t;
  272.  
  273.  
  274. type processor_set_t = mach_port_t
  275.         ctype: mach_port_t
  276. #if    KERNEL_SERVER
  277.         intran: processor_set_t convert_port_to_pset(mach_port_t)
  278.         outtran: mach_port_t convert_pset_to_port(processor_set_t)
  279.         destructor: pset_deallocate(processor_set_t)
  280. #endif    KERNEL_SERVER
  281.         ;
  282.  
  283. type processor_set_array_t = ^array[] of processor_set_t;
  284.  
  285. type processor_set_name_t = mach_port_t
  286.         ctype: mach_port_t
  287. #if    KERNEL_SERVER
  288.         intran: processor_set_t convert_port_to_pset_name(mach_port_t)
  289.         outtran: mach_port_t convert_pset_name_to_port(processor_set_t)
  290.         destructor: pset_deallocate(processor_set_t)
  291. #endif    KERNEL_SERVER
  292.         ;
  293.  
  294. type processor_set_name_array_t = ^array[] of processor_set_name_t;
  295.  
  296. type processor_set_info_t    = array[*:1024] of natural_t;    
  297. type processor_set_basic_info_data_t = struct[5] of int;
  298. type processor_set_sched_info_data_t = struct[2] of int;
  299.  
  300.  
  301. type kernel_version_t        = (MACH_MSG_TYPE_STRING, 512*8);
  302.  
  303. type time_value_t        = struct[2] of integer_t;
  304.  
  305. #if    KERNEL_SERVER
  306. simport <kern/ipc_kobject.h>;    /* for null conversion */
  307. simport <kern/ipc_tt.h>;    /* for task/thread conversion */
  308. simport <kern/ipc_host.h>;    /* for host/processor/pset conversions */
  309. simport <kern/task.h>;        /* for task_t */
  310. simport <kern/thread.h>;    /* for thread_t */
  311. simport <kern/host.h>;        /* for host_t */
  312. simport <kern/processor.h>;    /* for processor_t, processor_set_t */
  313. simport <vm/vm_object.h>;    /* for vm_object_t */
  314. simport <vm/vm_map.h>;        /* for vm_map_t */
  315. simport <ipc/ipc_space.h>;    /* for ipc_space_t */
  316. #endif    KERNEL_SERVER
  317.  
  318. #else    /* NEW_MACH_IPC */
  319.  
  320. #if    KERNEL_SERVER
  321. simport <kern/type_conversion.h>;
  322. #endif    KERNEL_SERVER
  323.  
  324. type task_t = port_t
  325. #if    KERNEL_SERVER
  326.         intran: task_t convert_port_to_task(port_t)
  327.         outtran: port_t convert_task_to_port(task_t)
  328.         destructor: task_deallocate(task_t)
  329. #endif    KERNEL_SERVER
  330.         ;
  331.  
  332.  
  333. type thread_t = port_t
  334. #if    KERNEL_SERVER
  335.         intran: thread_t convert_port_to_thread(port_t)
  336.         outtran: port_t convert_thread_to_port(thread_t)
  337.         destructor: thread_deallocate(thread_t)
  338. #endif    KERNEL_SERVER
  339.         ;
  340.  
  341. type thread_state_t        = array[*:1024] of int;
  342.  
  343. /*
  344.  * Mig doesn't handle translations of the components of an array,
  345.  * so use port_t instead of thread_t.
  346.  */
  347. type task_array_t = ^array[] of port_t;
  348. type thread_array_t = ^array[] of port_t;
  349.  
  350. type vm_task_t = port_t
  351. #if    KERNEL_SERVER
  352.         intran: vm_map_t convert_port_to_map(port_t)
  353.         destructor: vm_map_deallocate(vm_map_t)
  354. #endif    KERNEL_SERVER
  355.         ;
  356.  
  357. type vm_address_t = int;
  358. type vm_offset_t = int;
  359. type vm_size_t = int;
  360. type vm_prot_t = int;
  361. type vm_inherit_t = int;
  362. type vm_statistics_data_t = struct[13] of int;
  363. type vm_machine_attribute_t = int;
  364. type vm_machine_attribute_val_t = int;
  365.  
  366. type thread_info_t        = array[*:1024] of int;
  367. type task_info_t        = array[*:1024] of int;
  368.  
  369. type memory_object_t = port_t;
  370. type memory_object_control_t = port_t
  371. #if    KERNEL_SERVER
  372.         intran: vm_object_t vm_object_lookup(port_t)
  373.         outtran: port_t NEVER_HAPPENS(vm_object_t)
  374. #endif    KERNEL_SERVER
  375.         ;
  376. type memory_object_name_t = port_t;
  377.  
  378. type memory_object_copy_strategy_t = int;
  379.  
  380. type internal_memory_pointer_t =
  381.     ^array [] of MSG_TYPE_INTERNAL_MEMORY|MSG_TYPE_BYTE
  382.     ctype: pointer_t;
  383.  
  384. type machine_info_data_t = struct[5] of int;
  385. type machine_slot_data_t = struct[8] of int;
  386.  
  387. type vm_page_data_t = array[4096] of MSG_TYPE_BYTE;
  388.  
  389. type network_port_t = struct[6] of int;
  390.  
  391.  
  392. type host_t = port_t
  393. #if    KERNEL_SERVER
  394.         intran: host_t convert_port_to_host(port_t)
  395.         outtran: port_t convert_host_to_port(host_t)
  396. #endif    KERNEL_SERVER
  397.         ;
  398. type host_priv_t = port_t
  399. #if    KERNEL_SERVER
  400.         intran: host_t convert_port_to_host_priv(port_t)
  401. #endif    KERNEL_SERVER
  402.         ;
  403. type host_info_t             = array[*:1024] of int;
  404.  
  405. type processor_t = port_t
  406. #if    KERNEL_SERVER
  407.         intran: processor_t convert_port_to_processor(port_t)
  408.         outtran: port_t convert_processor_to_port(processor_t)
  409. #endif    KERNEL_SERVER
  410.         ;
  411. type processor_array_t         = ^array[] of port_t;
  412. type processor_info_t        = array[*:1024] of int;
  413.  
  414. type processor_set_t = port_t
  415. #if    KERNEL_SERVER
  416.         intran: processor_set_t convert_port_to_pset(port_t)
  417.         outtran: port_t convert_pset_to_port(processor_set_t)
  418.         destructor: pset_deallocate(processor_set_t)
  419. #endif    KERNEL_SERVER
  420.         ;
  421.  
  422. type processor_set_name_t = port_t
  423. #if    KERNEL_SERVER
  424.         intran: processor_set_t convert_port_to_pset_name(port_t)
  425.         outtran: port_t convert_pset_name_to_port(processor_set_t)
  426.         destructor: pset_deallocate(processor_set_t)
  427. #endif    KERNEL_SERVER
  428.         ;
  429.  
  430. type processor_set_name_array_t = ^array[] of port_t;
  431.  
  432. type processor_set_info_t    = array[*:1024] of int;    
  433.  
  434. type kernel_version_t        = (MSG_TYPE_STRING, 512*8);
  435.  
  436. #endif    /* NEW_MACH_IPC */
  437.  
  438. import <mach/mach_types.h>;
  439.  
  440. #endif    _MACH_MACH_TYPES_DEFS_
  441.